package com.bms.hystrix.controller.zl;


import com.bms.hystrix.pojo.ZiLiao;
import com.bms.hystrix.service.zl.ZiLiaoService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping(value = "ziLiao", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class ZiLiaoController {

    @Resource
    private ZiLiaoService ziLiaoService;
    //全部查询
    @GetMapping("/chaXunAll")
    public Map chaXunAll(ZiLiao ziLiao) {
        return ziLiaoService.chaXunAll(ziLiao);
    }
    //查询分页
    @GetMapping("/chaXunFenYe")
    public Map chaXunFenYe(int page, String biaoTi,String shangChuanShiJian) {
        return ziLiaoService.chaXunFenYe(page,biaoTi,shangChuanShiJian);
    }
    //基于id查询
    @GetMapping("/chaXunById")
    public Map chaXunById(Integer id) {
        return ziLiaoService.chaXunById(id);
    }
//基于id删除
    @GetMapping("/shanChuById")
    public Map shanChuById(String id) {
        return ziLiaoService.shanChuById(id);
    }
    //基于id更新数据
    @PostMapping("/gengXinById")
    public Map gengXinById(ZiLiao ziLiao) {
        return ziLiaoService.gengXinById(ziLiao);
    }
    //新增
    @PostMapping("/xinZeng")
    public Map xinZeng(ZiLiao ziLiao) {
        return ziLiaoService.xinZeng(ziLiao);
    }
    //浏览数量
    @PostMapping("/liuLanShuLiang")
    public Map liuLanShuLiang(ZiLiao ziLiao) {
        return ziLiaoService.liuLanShuLiang(ziLiao);
    }
    //下载量
    @PostMapping("/xiaZaiLiang")
    public Map xiaZaiLiang(ZiLiao ziLiao) {
        return ziLiaoService.xiaZaiLiang(ziLiao);
    }
}
